package com.koron.car.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author twcao
 * @title: Constants
 * @projectName GDH_EAM_V2
 * @description: 车辆管理常量
 * @date 2021/9/618:14
 */
public class Constants {

    public static final String CAR_APPLY_CODE = "SQ";

    public static final String CAR_MAINTAIN_CODE = "WX";

    public static final String CAR_KEEPUP_CODE = "BY";

    public static final String CAR_DELIMIT_CODE = "BZ";

    public static final class YesOrNo {
        public static final Integer YES = 1;
        public static final Integer NO = 0;
    }

    /**
     * 是否是基层用车字典，根据配置的单位决定
     */
    public static final class Primary {
        public static final String YES = "1";
        public static final String NO = "0";
    }

    /**
     * 用车类型
     */
    public static final class UsingCarType {
        // 长途-省外
        public static final String LONG_DISTANCE_OUTSITE = "long_distance_outsite";
        // 长途-省内
        public static final String LONG_DISTANCE_INSITE = "long_distance_insite";
        // 短途
        public static final String SHORT_DISTANCE = "short_distance";
    }

    /**
     * 司机类型
     */
    public static final class DriverType {
        // 专职司机
        public static final String FULL_TIME = "full_time";
        // 兼职司机
        public static final String PART_TIME = "part_time";
    }

    /**
     * 兼职司机审批状态
     */
    public static final class PartTimeState {
        // 草稿
        public static final String DRAFT = "draft";
        // 待审批
        public static final String WAIT_APPROVE = "wait_approve";
        //已完成
        public static final String FINISH = "finish";
    }

    public static final class AccidentState {
        // 草稿
        public static final String DRAFT = "draft";
        //已完成
        public static final String FINISH = "finish";
    }

    public static final class LendState {
        // 草稿
        public static final String DRAFT = "draft";
        // 已借出
        public static final String BORROWED = "borrowed";
        // 验收
        public static final String ACCEPT = "accept";
        // 已结束
        public static final String FINISH = "finish";

        public static final List<String> stateList = new ArrayList<>();

        static {
            stateList.add(DRAFT);
            stateList.add(BORROWED);
            stateList.add(ACCEPT);
            stateList.add(FINISH);
        }
    }

    /**
     * car_state
     */
    public static final class CarState {
        // 留用，只能用过手动修改，才能到此状态，上一个状态（null）
        public static final String RETENTION = "retention";
        // 空闲，上一个状态（出车、借出、维修、草稿）
        public static final String FREE = "free";
        // 出车，上一个状态（空闲）
        public static final String OUTSITE = "outsite";
        // 借出，上一个状态（空闲）
        public static final String LEND = "lend";
        // 维修，上一个状态（空闲，出车）
        public static final String MAINTENANCE = "maintenance";
        // 废弃，只能用过手动修改，才能到此状态，上一个状态（空闲，出车，借出，维修）
        public static final String DISCARD = "discard";
        // 草稿，上一个状态（null）
        public static final String DRAFT = "draft";

        public static final String MAINTAIN="maintain";
    }

    /**
     * 司机工作状态
     */
    public static final class DriverWorkState {
        // 草稿
        public static final String DRAFT = "draft";
        // 空闲
        public static final String FREE = "free";
        // 出车中
        public static final String OUTSITE = "outsite";
        //离线
        public static final String OFFLINE = "offline";

        public static final List<String> stateList = new ArrayList<>();

        static {
            stateList.add(DRAFT);
            stateList.add(FREE);
            stateList.add(OUTSITE);
            stateList.add(OFFLINE);
        }
    }

    /**
     * 维修保养类型
     */
    public static final class MaintainType {
        // 维修
        public static final String REPAIR = "repair";
        // 保养
        public static final String UPKEEP = "upkeep";
    }

    /**
     * 维修保养类型
     */
    public static final class MaintainState {
        // 草稿
        public static final String DRAFT = "DRAFT";
        // 待审核
        public static final String WAIT_REVIEW = "WAIT_REVIEW";
        // 待安排
        public static final String WAIT_ARRANGE = "WAIT_ARRANGE";
        // 验收
        public static final String ACCEPT = "ACCEPT";
        //已完成
        public static final String FINISH = "FINISH";

        public static final List<String> stateList = new ArrayList<>();

        static {
            stateList.add(DRAFT);
            stateList.add(WAIT_REVIEW);
            stateList.add(WAIT_ARRANGE);
            stateList.add(ACCEPT);
            stateList.add(FINISH);
        }
    }

    /**
     * 用车申请状态
     */
    public static final class ApplyState {
        // 草稿
        public static final String DRAFT = "DRAFT";
        // 待审核
        public static final String WAIT_REVIEW = "WAIT_REVIEW";
        // 待派车
        public static final String WAIT_DISPATCH = "WAIT_DISPATCH";
        // 已派车
        public static final String DISPATCHED = "DISPATCHED";
        // 待回车
        public static final String WAIT_RETURN = "WAIT_RETURN";
        //已完成
        public static final String FINISH = "FINISH";

        public static final List<String> stateList = new ArrayList<>();

        static {
            stateList.add(DRAFT);
            stateList.add(WAIT_REVIEW);
            stateList.add(WAIT_RETURN);
            stateList.add(FINISH);
        }
    }

    public static class PrepareType {
        // 经营管理
        public static final String DELIMIT_MANAGER = "delimit_manager";
        // 业务保障
        public static final String DELIMIT_SECURITY = "delimit_security";
        //未定编
        public static final String NOLIMIT = "nolimit";

        public static Map<String, String> typeMap = new HashMap<>();

        static {
            typeMap.put(DELIMIT_MANAGER, "JY");
            typeMap.put(DELIMIT_SECURITY, "YW");
        }
    }

    /**
     * 车辆编制申请
     */
    public static class DelimitApplyState {
        // 草稿
        public static final String DRAFT = "DRAFT";
        // 待审核
        public static final String WAIT_REVIEW = "WAIT_REVIEW";
        //已完成
        public static final String FINISH = "FINISH";
    }

    /**
     * 定编号状态
     */
    public static class DelimitState {
        // 未绑定
        public static final String UNBOUNDED = "unbounded";
        // 已绑定
        public static final String BINDING = "binding";
        // 更购中
        public static final String REPLACEMENT = "replacement";
    }

    /**
     * 更购审核状态
     */
    public static final class CarReplaceState {
        // 草稿
        public static final String DRAFT = "draft";
        // 待审批
        public static final String WAIT_APPROVE = "wait_approve";
        //已完成
        public static final String FINISH = "finish";
    }

    /**
     * car_fee_state
     * 费用登记状态
     */
    public static final class FeeState {
        // 草稿
        public static final String DRAFT = "draft";
        //已完成
        public static final String FINISH = "finish";
    }

    /**
     * car_fee_state
     * 费用登记状态
     */
    public static final class FeeType {
        // 停车费
        public static final String PARKFEE = "park_fee";
        // 路桥费
        public static final String TOILFEE = "toll_fee";
        // 邮费
        public static final String OILFEE = "oil_fee";
        // 维修保养费
        public static final String MATAINFEE = "matain_fee";
    }

    /**
     * car_bind_state
     * 编制绑定状态
     */
    public static final class BindState {
        // 草稿
        public static final String DRAFT = "draft";
        //已完成
        public static final String BINDING = "binding";
    }
}
